package com.shengyuan.manage_os.old.ying.erpm.bll;

import java.util.List;

import com.shengyuan.manage_os.old.ying.boce.jsy.ErpMapMarker;
import com.shengyuan.manage_os.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.TextView;

public class MarkAdapter extends ArrayAdapter<ErpMapMarker>{

	int resource;
	public MarkAdapter(Context context, int textViewResourceId,
			List<ErpMapMarker> objects) {
		super(context, textViewResourceId, objects);
		resource = textViewResourceId;
	}
	 @Override  
	    public View getView(int position, View v, ViewGroup parent) {  
	        ErpMapMarker item=getItem(position);  
	        LinearLayout todoView;  
	        String username = item.username;
	        String datetime = item.datetime;
	        if (v == null) {  
	            todoView = new LinearLayout(getContext());  
	            LayoutInflater iv = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);  
	            iv.inflate(resource, todoView, true);  
	              
	        } else {  
	            todoView = (LinearLayout)v;  
	        }  
	          
	        TextView marker_username = (TextView)todoView.findViewById(R.id.marker_username);  
	        TextView marker_time = (TextView)todoView.findViewById(R.id.marker_time);  
	        marker_username.setText(username);  
	        marker_time.setText(datetime);  
	        return todoView;  
	    }  

}
